From: Carlos Garnacho Date: Tue, 13 Nov 2018 17:26:13 +0000 (+0100) Subject: inputMethod: Avoid calling set_preedit_text() if unnecessary X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2~1^2~45 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8c3811a866017943c276fa7d9e2aed4c0f0554ae;p=gnome-shell.git inputMethod: Avoid calling set_preedit_text() if unnecessary This is easier down on clients. --- diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index 4a92dc49b..e22dfccc5 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -144,8 +144,11 @@ var InputMethod = new Lang.Class({ this._updateCapabilities(); } - // Unset any preedit text - this.set_preedit_text(null, 0); + if (this._preeditStr) { + // Unset any preedit text + this.set_preedit_text(null, 0); + this._preeditStr = null; + } }, vfunc_reset() { @@ -154,8 +157,11 @@ var InputMethod = new Lang.Class({ this._emitRequestSurrounding(); } - // Unset any preedit text - this.set_preedit_text(null, 0); + if (this._preeditStr) { + // Unset any preedit text + this.set_preedit_text(null, 0); + this._preeditStr = null; + } }, vfunc_set_cursor_location(rect) {